package Test11_02;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;



public class ConnectionDemo02 {
	public static final String DBDRIVER = "com.mysql.jdbc.Driver";
	public static final String DBURL = "jdbc:mysql://localhost:3306/publicdemoprac";
	public static final String DBUSER = "root";
//	public static final String DBPASS = "root";
	public static final String DBPASS = "123456";
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Connection conn = null;
		try{
			Class.forName(DBDRIVER);
		}catch(ClassNotFoundException e){
			e.printStackTrace();
		}
		try{
			conn=DriverManager.getConnection(DBURL, DBUSER, DBPASS);
		}catch(SQLException e){
			e.printStackTrace();
		}
		System.out.println(conn);
		try{
			conn.close();
		}catch(SQLException e){
			e.printStackTrace();
		}
	}

}
